﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Send_RF
{
    class Moway
    {
        private int id;
        private int speed;
        private int battery;

        private long lastComm;

        /*private int direction;
        private int leftObstacles;
        private int rightObstacles;
        private int leftLineSnsr;
        private int rightLineSnsr;*/

        public int Id
        {
            get { return id; }
        }

        public int Speed
        {
            get { return speed; }
        }

        public int Battery
        {
            get { return battery; }
        }

        public long LastComm
        {
            get { return lastComm; }
        }

        public Moway(int id, int speed, int battery)
        {
            this.id = id;
            this.speed = speed;
            this.battery = battery;
            this.lastComm = System.DateTime.Now.Ticks;
        }

        public void updateData(int speed, int battery, long time)
        {
            this.speed = speed;
            this.battery = battery;
            this.lastComm = time;
        }

        public override String ToString()
        {
            return "[" + this.id + "," + this.speed + "," + this.battery + "," + (new DateTime(this.LastComm)).ToString("HH:mm:ss tt") + "]";
        }

    }
}
